package cn.com.sbell.vss;

//import java.text.MessageFormat;

/**
 * @author Yifu.HUANG
 * 
 */
public class VssException extends RuntimeException {
	private String resultCode;

	// private String message;

	private String[] arguments;

	public VssException(String resultCode) {
		this.resultCode = resultCode;
	}

	public VssException(String resultCode, String field) {
		this(resultCode, new String[] { field });
	}

	public VssException(String resultCode, String[] fields) {
		this.resultCode = resultCode;
		this.arguments = fields;
	}

	/*
	 * public VssException(String resultCode, String message) { this.resultCode =
	 * resultCode; this.message = message; }
	 * 
	 * public VssException(String resultCode, String message, String[]
	 * arguments) { this.resultCode = resultCode; this.message = message;
	 * this.arguments = arguments; }
	 */
	public String getResultCode() {
		return resultCode;
	}

	/*
	 * public String getMessage() { return message; }
	 * 
	 * public void setMessage(String message) { this.message = message; }
	 */
	public String[] getFields() {
		return arguments;
	}

	/**
	 * Need set message and set arguments first
	 * 
	 * @return
	 */
	/*
	 * public String getFormatedMessage() { if (message == null || arguments ==
	 * null || arguments.length == 0) { return message; } try { return
	 * MessageFormat.format(message, (Object[])arguments); } catch
	 * (IllegalArgumentException e) { return message; } }
	 */
}
